package test;

import java.awt.DisplayMode;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;

import javax.swing.JFrame;

public class FullScreenDemo {
	public static void main(String[] args) {
		JFrame frame=new JFrame();
		DisplayMode dm= new DisplayMode(800, 600, 16, 75);
		GraphicsEnvironment ge= GraphicsEnvironment.getLocalGraphicsEnvironment();
		GraphicsDevice gd = ge.getDefaultScreenDevice();
		gd.setFullScreenWindow(frame);
		if(dm!=null&&gd.isFullScreenSupported()){
			try {
				gd.setDisplayMode(dm);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
	

}
